/* Copyright (c) 2004-2024 Peigen.info. All rights reserved. */

package info.peigen.hotpot.business.account.core.repository.service;

import info.peigen.hotpot.business.account.core.repository.entity.AccountTransLogEntity;
import info.peigen.hotpot.business.account.core.repository.mapper.AccountTransLogMapper;
import info.peigen.hotpot.business.account.facade.enums.AccountTransCode;
import info.peigen.hotpot.component.data.repository.beetlsql.service.AbstractBeetlSqlRepository;
import org.noear.solon.annotation.Component;

import java.util.List;

/**
 * <b>(AccountTransLogRepository)</b>
 *
 * @author Peigen
 * @version 1.0.0
 * @since 2021/8/5
 */
@Component
public class AccountTransLogRepository extends AbstractBeetlSqlRepository<AccountTransLogMapper, AccountTransLogEntity> {
    public AccountTransLogEntity findByTransLogId(String transLogId) {
        return getMapper().findByTransLogId(transLogId);
    }

    public List<AccountTransLogEntity> findByTradeId(String tradeId) {
        return getMapper().findByTradeId(tradeId);
    }

    public AccountTransLogEntity findByTradeIdAndTransCode(String tradeId, AccountTransCode transCode) {
        return getMapper().findByTradeIdAndTransCode(tradeId, transCode);
    }

    public void deleteByTransLogId(String transLogId) {
        getMapper().deleteByTransLogId(transLogId);
    }

    public void deleteByTradeId(String tradeId) {
        getMapper().deleteByTradeId(tradeId);
    }
}